-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve missing nodetoolkit #1
base: master
Are you sure you want to change the base?
Conversation
@@ -568,7 +560,6 @@ private void applyConfig0(NodeConfig config) throws Exception { | |||
|
|||
trackFunction("(instance creation)"); | |||
|
|||
// _python = new PythonInterpreter(globals, pySystemState); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's strange this object gets built up with the correct working directories but never passed to the interpreter.
You can achieve the same result from within the Jython interpreter by doing this after the node launches. import sys
sys.path.append(_node.getRoot().getAbsolutePath())
sys.path.append(str(_node.getRoot().getAbsolutePath()) + '\\.nodel')
from nodetoolkit import * If you wanted to do it from Java whilst instantiating the interpreter object, just before the script launches, this works as well. _python.exec("import sys");
_python.exec("sys.path.append(_node.getRoot().getAbsolutePath())");
_python.exec("sys.path.append(str(_node.getRoot().getAbsolutePath()) + '\\.nodel')");
_python.exec("from nodetoolkit import *"); |
As mentioned in the public PR (museumsvictoria#250 (comment)) the nodetoolkit which provides all the action/event and utility functions wasn't available in the Jython interpreter.
It seems this was because the toolkit itself
node_root/.nodel/nodetoolkit.py
was missing from sys.path. There was an attempt to add it to the pySystemState but for some reason this was commented out in the original code.I also took the opportunity to update this endeavour to Jython 2.7.3 which came out recently.